package com.dotndot.controller.Server;

import android.graphics.Bitmap;
import android.os.Bundle;

import com.dotndot.controller.network.define.INetworkAPI.REQUEST;

public class SendServerParam implements ISendServer
{
    private REQUEST api = null;
    private Bundle param = null;

    public SendServerParam()
    {
        if( param == null )
        {
            param = new Bundle();
        }
        api = null;
    }

    public SendServerParam( REQUEST api )
    {
        this();
        setApi(api);
    }

    @Override
    public void setApi( REQUEST api )
    {
        this.api = api;
    }

    @Override
    public REQUEST getApi()
    {
        return this.api;
    }

    @Override
    public void put( String key, String value )
    {
        param.putString(key, value);
    }

    @Override
    public String get( String key )
    {
        return param.getString(key);
    }

    @Override
    public void put( Enum<?> key, String value )
    {
        param.putString(key.name(), value);
    }

    @Override
    public String get( Enum<?> key )
    {
        return param.getString(key.name());
    }

    @Override
    public void putBitmap( Enum<?> key, Bitmap bitmap )
    {
        param.putParcelable(key.name(), bitmap);
    }

    @Override
    public Bitmap getBitmap( Enum<?> key )
    {
        return param.getParcelable(key.name());
    }

    @Override
    public int size()
    {
        return param.size();
    }

}
